#include "ActionTimer.h"

void ActionTimer::LogTime(void)
{
	m_Now = clock();
	m_Passed = m_Now - m_Then;
	m_AccumulatedTime += m_Passed;
	m_TotalTime += m_AccumulatedTime;
	m_Then = m_Now;
	m_Soon = m_Now + 50;
}

bool ActionTimer::IsTime(int a_Time)
{
	if(m_AccumulatedTime >= a_Time)
	{
		m_AccumulatedTime = 0;
		return true;
	}
	return false;
}

bool ActionTimer::Throttle(void)
{
	if(clock()<m_Soon)
		return true;
	return false;
}